package com.example.cookbook;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class MyDBHelper extends SQLiteOpenHelper {
    // 数据库的名称  数据库的版本号
    private static final String DBNAME="zscourse1.db";
    private static final int VERSION=1;
    //构造方法
    public MyDBHelper(Context context) {
        super(context, DBNAME, null, VERSION);
    }
    //创建数据库
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table tb_recipe(" +
                "id integer primary key autoincrement," +
                "recipeId varchar(50)," +
                "recipeName varchar(20)," +
                "recipeDesc varchar(20)," +
                "recipeSmallImgUrl varchar(100));");
    }
    //升级数据库
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }

}